package cn.wit.test;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class DemoRedirect extends HttpServlet{
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	
		//网页跳转
//		resp.sendRedirect("http://baidu.com");
		
		resp.setStatus(HttpServletResponse.SC_FOUND);
		
		//还有问题，不知道如何使用
		resp.setHeader("Location", "index.html");
	}

}
